﻿using DFGK_WMS.Model.DTO;
using DFGK_WMS.Model.Models;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.IRepository
{
    /// <summary>
    /// 出库
    /// </summary>
    public interface ITOutboundOrderDetailRepository : IBaseRepository<TShippingOrderDetail>
    {

   

        /// <summary>
        /// 获取出库单明细表数据
        /// </summary>
        /// <param name="criteria">筛选条件</param>
        /// <returns>返回实体对象</returns>
        TShippingOrderDetail GetShippingOrderDetail(int OrderId);
        /// <summary>
        /// 获取出库站台
        /// </summary>
        /// <param name="WhId"></param>
        /// <param name="Status"></param>
        /// <returns></returns>
        List<TStation> GetStation(int WhId);


       

        

       

        /// <summary>
        /// 获取出库单明细  多个物料版本
        /// </summary>
        /// <returns></returns>
        List<TShippingOrderDetailPlusDTOGroup> GetTShippingOrderDetailPlus(int pageIndex, int pageSize, int isNetWork);




        /// <summary>
        /// 首次提交，更新库存中状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int UpdStatus(int id);

        

        /// <summary>
        /// 根据ID查询入库垛信息
        /// </summary>
        /// <param name="PalletBarcode"></param>
        /// <returns></returns>
        List<TStackingStorage> GetStackingStorages(string[] PalletBarcode);


       


        /// <summary>
        /// 拣选出库
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        bool AddPickingOutbound(TPickingStationDatum item);

 

        /// <summary>
        /// 获取拣选出库详情
        /// </summary>
        /// <param name="PickingStationDataId"></param>
        /// <returns></returns>
        List<TPickingStationDataDetail> GetPickingStationDetail(int PickingStationDataId);

        /// <summary>
        /// 获取库存数量
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        decimal GetInventoryQuantity(int? MaterialId);

        /// <summary>
        /// 减去库存数量并修改库存状态
        /// </summary>
        /// <param name="num"></param>
        /// <returns></returns>
        bool GetDwindleNumbers(TInventory inventory,decimal? num);

        /// <summary>
        /// 提交出库执行
        /// </summary>
        /// <param name="id"></param>
        /// <param name="shippingOrderDetail"></param>
        /// <returns></returns>
        bool RunShippingOrderDetail(int id, TShippingOrderDetail shippingOrderDetail, out string message);


        /// <summary>
        /// 出库复核
        /// </summary>
        /// <param name="OrderDTO"></param>
        /// <returns></returns>
        bool SubmitOutInventoryReview(SubmitOutListDTO OrderDTO,out string message);


        bool ChukuMsg(SubmitOutListDTONoNet OrderDTO, out string errorMsg,out List<TLog> logs);
        /// <summary>
        /// 无网版本
        /// </summary>
        /// <param name="OrderDTO"></param>
        /// <param name="errorMsg"></param>
        /// <param name="logs"></param>
        /// <returns></returns>
        bool ChukuMsgNoNet(SubmitOutListDTONoNet OrderDTO, out string errorMsg, out List<TLog> logs);
    }
}
